typedef unsigned short wchar_t;
typedef wchar_t WCHAR; | This wide character definition actually appears in file basetyps.h. Wide (or Unicode) characters are 16 bits. Note how one typedef can be based on another. WCHAR derives from wchar_t, which in turn derives from short. |
typedefWCHAR *PWCHAR;
typedefWCHAR *LPWCH, *PWCH;
NWPSTR, LPW
typedefWCHAR *NWPSTR;
typedefWCHAR *LPWSTR, *PWSTR; | PWCHAR points to a Unicode character, which can also be the start of a Unicode string. LPWCH and PWCH are the same. STR and PWSTR are identicalthey just suggest the idea of a string (STR) instead of a character. Why so many different ways of describing a pointer to a Unicode string? I would say for the convenience of programmers, though this does seem to be overkill.
|
typedef const WCHAR *LPCWSTR,
*PCWSTR; | These two declarations include the const specifier that says the type points to constant datadata that is not expected to change. Visual Basic programmers can ignore the const keyword because const data types are treated the same as those that are not constant. |
typedef CHAR *PCHAR;
typedef CHAR *LPCH, *PCH;
typedef CONST CHAR *LPCCH, *PCCH;
typedef CHAR *NPSTR;
typedef CHAR *LPSTR, *PSTR;
typedef CONST CHAR *LPCSTR, *PCSTR; | CHAR was defined earlier as a char. PCHAR, LPCH, PCH, LPCCH, PCCH, NPSTR, LPSTR, PSTR, LPCSTR, and PCSTR are all exactly the same thingpointers to a variable with the char data type. As you now know, this is the same as a pointer to a NULL-terminated string. |
typedef SHORT *PSHORT;
typedef LONG *PLONG; | Pointers to short data or long data. The numeric cases are considerably simpler than characters. |
typedef void *HANDLE;
typedef HANDLE *PHANDLE; | A HANDLE is defined as a pointer to any data type. This may seem odd, since VB programmers are used to dealing with handles as 32-bit long values. There is no conflicta pointer is 32 bits wide, so |